import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LayoutComponent } from './pages/global/layout/layout.component';
import { AuthGuardService } from './services/auth-guard.service';

const routes: Routes = [
  {
    path: 'login',
    loadChildren: './pages/login/login.module#LoginModule'
  },
  {
    path: '',
    loadChildren: './pages/dashboard/dashboard.module#DashboardModule'
    // loadChildren: './pages/login/login.module#LoginModule'
  },

  {
    path: 'pages',
    component: LayoutComponent,
    canActivate: [AuthGuardService],
    children: [

      {
        path: 'info',
        loadChildren: './widgets/blank-page/blank-page.module#BlankPageModule'
      },
      {
        path: 'demo',
        loadChildren: './pages/demo/demo.module#DemoModule'
      },
      {
        path: 'dashboard',
        loadChildren: './pages/dashboard/dashboard.module#DashboardModule'
      },
      {
        path: 'onetomany',
        loadChildren: './pages/onetomany/onetomany.module#OnetomanyModule'
      },
      {
        path: 'onetomanyList',
        loadChildren: './pages/onetomany/list/onetomany-list.module#OnetomanyListModule'
      },
      {
        path: 'onetoone',
        loadChildren: './pages/onetoone/onetoone.module#OnetooneModule'
      },
      {
        path: 'onetooneList',
        loadChildren: './pages/onetoone/list/onetoone-list.module#OnetooneListModule'
      },
      {
        path: 'statistics',
        loadChildren: './pages/data/data.module#DataModule'
      },
      {
        path: 'publicoffering',
        loadChildren: './pages/public-offering/public-offering.module#PublicOfferingModule'
      },
      {
        path: 'publicofferingList',
        loadChildren: './pages/public-offering/list/public-offering-list.module#PublicOfferingListModule'
      },
      {
        path: 'annuity',
        loadChildren: './pages/annuity/annuity.module#AnnuityModule'
      },
      {
        path: 'annuityList',
        loadChildren: './pages/annuity/list/annuity-list.module#AnnuityListModule'
      },
      {
        path: 'social',
        loadChildren: './pages/social/social.module#SocialModule'
      },
      {
        path: 'socialList',
        loadChildren: './pages/social/list/social-list.module#SocialListModule'
      },
      {
        path: 'oldage',
        loadChildren: './pages/oldage/oldage.module#OldageModule'
      },
      {
        path: 'oldageList',
        loadChildren: './pages/oldage/list/oldage-list.module#OldageListModule'
      },
      {
        path: 'oldageProduct',
        loadChildren: './pages/oldage-product/oldage-product.module#OldageProductModule'
      },
      {
        path: 'oldageProductList',
        loadChildren: './pages/oldage-product/list/oldage-product-list.module#OldageProductListModule'
      },
      {
        path: 'fundAttach',
        loadChildren: './pages/fund-attach/fund-attach.module.ts#FundAttachModule'
      },
      {
        path: 'entry',
        loadChildren: './pages/entry/entry.module#EntryModule'
      },
      {
        path: 'contract',
        loadChildren: './pages/contract-extension/contract-extension.module#ContractExtensionModule'
      },
      {
        path: 'product-info',
        loadChildren: './pages/product-info/product-info.module#ProductInfoModule'
      },
      {
        path: 'system',
        loadChildren: './pages/system-admin/system-admin.module#SystemAdminModule'
      },
      // NQDII START
      // NQDII 条目查看
      {
        path: 'rcmnqdii/NQDII/view',
        loadChildren: './pages/risk-control/nqdii/list/view/view.module#ViewModule'
      },
      // NQDII 条目录入
      {
        path: 'rcmnqdii/NQDII/record',
        loadChildren: './pages/risk-control/nqdii/list/record/record.module#RecordModule'
      },
      {
        path: 'rcmnqdii/NQDII/modify',
        loadChildren: './pages/risk-control/nqdii/list/modify/modify.module#ModifyModule'
      },
      {
        path: 'rcmnqdii/NQDII/review',
        loadChildren: './pages/risk-control/nqdii/list/review/review.module#ReviewModule'
      },
      {
        path: 'rcmnqdii/NQDII/dataInTransit',
        loadChildren: './pages/risk-control/nqdii/list/data-in-transit/data-in-transit.module#DataInTransitModule'
      },
      // NQDII END
      // QDII START
      // QDII 条目查看
      {
        path: 'rcmqdii/QDII/view',
        loadChildren: './pages/risk-control/qdii/list/view/view.module#ViewModule'
      },
      // QDII 条目录入
      {
        path: 'rcmqdii/QDII/record',
        loadChildren: './pages/risk-control/qdii/list/record/record.module#RecordModule'
      },
      // QDII 条目复核
      {
        path: 'rcmqdii/QDII/review',
        loadChildren: './pages/risk-control/qdii/list/review/review.module#ReviewModule'
      },
       // QDII 基金条目
       {
        path: 'rcmqdii/QDII/fundEntry',
        loadChildren: './pages/risk-control/qdii/list/fund-entry/fund-entry.module#FundEntryModule'
      },
       // QDII 在途数据
       {
        path: 'rcmqdii/QDII/dataInTransit',
        loadChildren: './pages/risk-control/qdii/list/data-in-transit/data-in-transit.module#DataInTransitModule'
      },
      

      // QDII END
      // 风控投资范围start
      {
        path: 'rcminvest/INVEST/viewTarget',
        loadChildren: './pages/risk-control/invest/list/view/view-page.module#ViewPageModule'
      },
      {
        path: 'rcminvest/INVEST/modifyTarget',
        loadChildren: './pages/risk-control/invest/list/modify/modify-page.module#ModifyPageModule'
      },
      {
        path: 'rcminvest/INVEST/reviewTarget',
        loadChildren: './pages/risk-control/invest/list/review/review-page.module#ReviewPageModule'
      },
      // 风控投资范围end
      {
        path: 'rcmfund/FUND',
        loadChildren: './pages/risk-control/fund/fund.module#FundModule'
      },
      {
        path: 'param-setting',
        loadChildren: './pages/param-setting/param-setting.module#ParamSettingModule'
      }
    ]
  },

  // { path: '**', component: NoFoundComponent },
];

@NgModule({
  //imports: [RouterModule.forRoot(routes,{useHash:true})],
  imports: [RouterModule.forRoot(routes, { useHash: true })],
  exports: [RouterModule]
})
export class AppRoutingModule {
}
